package com.yuan.rest.service.Impl;

import com.yuan.rest.entrity.SysMenu;
import com.yuan.rest.repository.DeptRepository;
import com.yuan.rest.repository.SysMenuRepository;
import com.yuan.rest.service.DeptService;
import com.yuan.rest.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;

/**
 * @Auther: SiYuan
 * @Date: 2019/1/10 15:54
 * @Description:
 */
@Service
public class MenuServiceImpl implements MenuService {
    @Autowired
    private SysMenuRepository sysMenuRepository;

    @Override
    public SysMenu getMenu() {
        Specification specification = new Specification() {
            @Override
            public Predicate toPredicate(Root root, CriteriaQuery criteriaQuery, CriteriaBuilder criteriaBuilder) {
             return  criteriaBuilder.like(root.get("username").as(String.class), "a%");
            }
        };
        return null;
    }
}
